﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using FbKPI.Facade;
using FbKPI.Model;

namespace FBKPI.Forms
{
    public partial class UserInfoForm : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                int ID = Request.QueryString["User"] == string.Empty ? 0 : Convert.ToInt16(Request.QueryString["User"]);
                EmployeeFacade ef = new EmployeeFacade();
                Employee employees = ef.GetEmployeeByID(ID);

                if (employees != null)
                {
                    txt_firstname.Text = employees.FirstName;
                    txt_lastname.Text = employees.LastName;
                    txt_phonenumber.Text = employees.Phone;
                }
            }
        }
    }
}